import { EventDispatcher } from "../core/EventDispatcher";

export class VCairnEvent {
    private readonly _data:any;
    private readonly _type:string;
    static ERROR_CODE:string = '__ERROR_CODE__';

    get type() { return this._type; }
    get data() { return this._data; }

    constructor(type:string, data?:any) {
        this._type = type;
        this._data = data;
    }

    emit() {
        EventDispatcher.getInstance().emit(this);
    }

}